<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxr="http://nuxeo.org/nxweb/resources"
  class="nx-page nx-branding">

  <f:view contentType="text/html" />
  <f:event listener="#{nuxeoWebResourceDispatcher.processEvent}" type="preRenderView" />

  <h:head id="pageHead">

    <nxu:set var="pageFlavor" value="#{pageFlavor}" cache="true">
      <nxr:insert target="#{nuxeoWebResourceDispatcher.headStartTarget}" />
    </nxu:set>

    <title>
      <ui:insert name="page title" />
    </title>

    <ui:insert name="bookmark" />

    <ui:remove>
      Compat templating zones
    </ui:remove>
    <ui:insert name="stylesheets" />
    <ui:insert name="header_scripts" />

    <ui:insert name="page head resources">
      <nxu:set var="pageCssTarget" value="#{nuxeoWebResourceDispatcher.headStartTarget}">
      <nxu:set var="pageJsBodyStartTarget" value="#{nuxeoWebResourceDispatcher.bodyStartTarget}">
      <nxu:set var="pageJsTarget" value="#{nuxeoWebResourceDispatcher.headJavaScriptTarget}">
        <ui:include src="/incl/page_head.xhtml" />
      </nxu:set>
      </nxu:set>
      </nxu:set>
    </ui:insert>
    <ui:insert name="page head" />

    <nxr:meta name="apple-itunes-app"
      content="app-id=#{frameworkPropertyActions.getProperty('nuxeo.mobile.application.itunesId')}, app-argument=#{baseURL}#{currentDocument.repositoryName}/#{currentDocument.id}" />

    <nxr:insert target="headend" />
  </h:head>
  <h:body>

    <nxr:insert target="#{nuxeoWebResourceDispatcher.bodyStartTarget}" />

    <nxu:set var="pageCssTarget" value="#{nuxeoWebResourceDispatcher.headStartTarget}">
    <nxu:set var="pageJsBodyStartTarget" value="#{nuxeoWebResourceDispatcher.bodyStartTarget}">
    <nxu:set var="pageJsTarget" value="#{nuxeoWebResourceDispatcher.bodyJavaScriptTarget}">

      <div class="includes displayNone">
        <ui:insert name="basic body includes" />
      </div>

      <noscript>
        <div class="noscriptMessage">
          <span>#{messages['label.noscript.message']}</span>
        </div>
      </noscript>

      <ui:insert name="basic body" />

    </nxu:set>
    </nxu:set>
    </nxu:set>

    <nxr:insert target="#{nuxeoWebResourceDispatcher.bodyEndTarget}" />

  </h:body>

</html>
